package com.baomidou.mybatisplus.criterion;

/**
 * A criterion that is a wrapper for another, negating the wrapped one.
 * @author Timothy Ren
 */
public class NotExpression implements QueryCriterion {

	private static final long serialVersionUID = 1L;
	private QueryCriterion criterion;

	protected NotExpression(QueryCriterion criterion) {
		this.criterion = criterion;
	}

	public String toSqlString() {
		return "not (" + criterion.toSqlString() + ")";
	}

	public Object[] getValueArr() {
		return criterion.getValueArr();
	}

	public String toString() {
		return "not (" + criterion.toString() + ")";
	}
}
